package com.cplatform.movie.back.avtivities.entity;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonProperty;

@Entity
@Table(name="T_SMALL_ACTIVIEITS")
public class Activities {
	private Long id;
	private String name; 	// 活动名称
	private Long type; 		// 活动类型规则  1:满x件商品赠y件商品  2:订单满x金额减y金额  3:满x件商品折扣率为order_price_discount
	private String explain; // 活动规则说明/详情
	private String imgPath; // 活动图片
	private Long  orderItemNum; 	// 订单商品数量  规则1使用	
	private Long freeItemNum; 		// 免赠商品数量  规则1使用
	private Double orderTotalPrice; // 订单总额 规则2使用
	private Double freeTotalPrice;	// 订单免额 规则2使用
	private Double orderPriceDiscount; // 折扣率 规则3使用 
	private String startTime;	// 活动开始日期
	private String endTime; 	// 活动结束日期
	private String createTime;	// 创建日期
	private Long createUser;	// 创建人
	private Long status;		// 状态 -1：已删除 0：未审核 1：待审核 2：审核驳回  3：审核通过
	private Long isValid;		// 0:未上线 1：已上线
	
	public static Map<Long, String> auditStatusMap = null;	// 审核状态
	public static Map<Long, String> saleStatusMap = null;	// 上下架状态
	public static Map<Long, String> typeMap = null;	// 上下架状态
	static {
		auditStatusMap = new HashMap<Long, String>();
		auditStatusMap.put(0l, "未审核");
		auditStatusMap.put(1l, "待审核");
		auditStatusMap.put(2l, "审核驳回");
		auditStatusMap.put(3l, "审核通过");
		
		saleStatusMap = new HashMap<Long, String>();
		saleStatusMap.put(0l, "未上线");
		saleStatusMap.put(1l, "已上线");
		
		typeMap = new HashMap<Long, String>();
		typeMap.put(1l, "满赠商品");
		typeMap.put(2l, "满减金额");
	}
	
	@SequenceGenerator(name = "seq_item", sequenceName = "SEQ_SMALL_SHOP_SEQ")
	@Id
	@GeneratedValue(generator = "seq_item")
	@JsonProperty
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name="NAME")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name="TYPE")
	public Long getType() {
		return type;
	}
	public void setType(Long type) {
		this.type = type;
	}
	
	@Column(name="EXPLAIN")
	public String getExplain() {
		return explain;
	}
	public void setExplain(String explain) {
		this.explain = explain;
	}
	
	@Column(name="IMG_PATH")
	public String getImgPath() {
		return imgPath;
	}
	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}
	@Column(name="ORDER_ITEM_NUM")
	public Long getOrderItemNum() {
		return orderItemNum;
	}
	public void setOrderItemNum(Long orderItemNum) {
		this.orderItemNum = orderItemNum;
	}
	
	@Column(name="FREE_ITEM_NUM")
	public Long getFreeItemNum() {
		return freeItemNum;
	}
	public void setFreeItemNum(Long freeItemNum) {
		this.freeItemNum = freeItemNum;
	}
	
	@Column(name="ORDER_TOTAL_PRICE")
	public Double getOrderTotalPrice() {
		return orderTotalPrice;
	}
	public void setOrderTotalPrice(Double orderTotalPrice) {
		this.orderTotalPrice = orderTotalPrice;
	}
	
	@Column(name="FREE_TOTAL_PRICE")
	public Double getFreeTotalPrice() {
		return freeTotalPrice;
	}
	public void setFreeTotalPrice(Double freeTotalPrice) {
		this.freeTotalPrice = freeTotalPrice;
	}
	
	@Column(name="ORDER_PRICE_DISCOUNT")
	public Double getOrderPriceDiscount() {
		return orderPriceDiscount;
	}
	public void setOrderPriceDiscount(Double orderPriceDiscount) {
		this.orderPriceDiscount = orderPriceDiscount;
	}
	
	@Column(name="START_TIME")
	public String getStartTime() {
		return startTime;
	}
	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}
	
	@Column(name="END_TIME")
	public String getEndTime() {
		return endTime;
	}
	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	
	@Column(name="CREATE_TIME")
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	
	@Column(name="CREATE_USER")
	public Long getCreateUser() {
		return createUser;
	}
	public void setCreateUser(Long createUser) {
		this.createUser = createUser;
	}
	
	@Column(name="STATUS")
	public Long getStatus() {
		return status;
	}
	public void setStatus(Long status) {
		this.status = status;
	}
	
	@Column(name="IS_VALID")
	public Long getIsValid() {
		return isValid;
	}
	public void setIsValid(Long isValid) {
		this.isValid = isValid;
	}
	
	/** 创建结束时间**/
	private String createEndTime;

	@Transient
	public String getCreateEndTime() {
		return createEndTime;
	}
	public void setCreateEndTime(String createEndTime) {
		this.createEndTime = createEndTime;
	}
	
	
}
